import React from 'react'
import { withRouter } from 'react-router-dom'
import notfund from '@assets/img/404.png'
import notPremission from '@assets/img/403.png'

function NotFound(props) {
  let allRoutekey =  props.allRouteList.map(item => item.key)
  return (
    <div style={{width:'40%',margin: '0 auto',display:'block',}}>
      {
        allRoutekey.includes(props.location.pathname) ?
        <img width='100%' src={notPremission} alt='403' title='403'/>
        :
        <img width='100%' src={notfund} alt='404' title='404' />
      }
    </div>
  )
}

export default withRouter(NotFound)